package io.kiki.sba.registry.server.clientInterface.registry;

import io.kiki.sba.registry.api.Channel;
import io.kiki.sba.registry.common.model.ClientToClientInterfaceServerNodeId;
import io.kiki.sba.registry.common.model.store.StoreData;

import java.util.List;


public interface Registry {

    /**
     * register new publisher or subscriber data
     */
    void register(Channel channel, StoreData<String> storeData);

    /**
     * clean all the connectIds: 1. clean pubs/sub/wat
     */
    void clean(List<ClientToClientInterfaceServerNodeId> clientToClientInterfaceServerNodeIdList);

    /**
     * client off the connectIds: 1. clean pubs, keep sub/wat; 2. check sub
     */
    void clientOff(List<ClientToClientInterfaceServerNodeId> clientToClientInterfaceServerNodeIdList);

    /**
     * disable the connectIds: 1. clean pub/sub/wat; 2. check sub
     */
    void blacklist(List<ClientToClientInterfaceServerNodeId> clientToClientInterfaceServerNodeIdList);

    /**
     * message mode com.alipay.sofa.registry.client.provider for client node to unregister single
     * subscriber or publisher data
     */
    void unRegister(StoreData<String> storeData);

    /**
     * for scheduler clean no connect client
     */
    void cleanClientConnect();
}
